﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLK.Database.DALs;

namespace QLK.Database.BLLs
{
    public class Transfer_ProductBLL
    {
        private Transfer_ProductDAL dal;

        public Transfer_ProductBLL()
        {
            dal = new Transfer_ProductDAL();
        }

        public List<Transfer_Product> Transfer_ProductGetAll()
        {
            return dal.Transfer_ProductGetAll();
        }

        public Transfer_Product Transfer_ProductGetByID(int TransID, int ProID)
        {
            if (TransID > 0 && ProID > 0)
                return dal.Transfer_ProductGetByID(TransID, ProID);
            return null;
        }

        public bool Transfer_ProductDeleteByID(int TransID, int ProID)
        {
            return dal.Transfer_ProductDeleteByID(TransID, ProID);
        }

        public bool Transfer_ProductUpdate(Transfer_Product tps)
        {
            if (dal.Transfer_ProductCheckDuplicateProduct(tps.TransferID, tps.ProductID))
                return dal.Transfer_ProductUpdate(tps);
            return false;
        }

        public bool Transfer_ProductInsert(Transfer_Product tps)
        {
            if (dal.Transfer_ProductCheckDuplicateProduct(tps.TransferID, tps.ProductID))
                return dal.Transfer_ProductInsert(tps);
            return false;
        }
    }
}
